/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.koller.million.card.frame.item;

import de.koller.million.card.engine.item.Item;
import de.koller.million.card.engine.item.ItemQuality;
import de.koller.million.card.engine.item.ItemSlot;
import de.koller.million.card.engine.item.NormalSpawn;
import java.awt.GridLayout;

/**
 *
 * @author User
 */
public class ItemPreviewComp extends javax.swing.JFrame {

	/**
	 * Creates new form ItemPreviewComp
	 */
	public ItemPreviewComp() {
		initComponents();
		
		int ilvlstart = 0;
		int ilvlend = 30;
		this.setLayout( new GridLayout( 0, ilvlend - ilvlstart ) );
		
		ItemSlot s = ItemSlot.Wrist;
		double fullEquipt = 0;
		for( int i = 0; i < ItemSlot.values().length; i++ )
			fullEquipt += ItemSlot.values()[i].factor;
		
		System.out.println( "FullEquipt Factor: " + fullEquipt + " using factor: " + s.factor );
		
		
		for( int q = 0; q < ItemQuality.values().length; q++ ) {
			for( int il = ilvlstart; il < ilvlend; il++ ) {
				Item i = NormalSpawn.getBest( ItemQuality.values()[q], s, il );
				ItemSlotPanel isp = new ItemSlotPanel();
				isp.setItem( i );
				this.add( isp );
			}
		}
		
		this.pack();
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings( "unchecked" )
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Vorschau");
        setAlwaysOnTop(true);
        setLocationByPlatform(true);
        setResizable(false);
        getContentPane().setLayout(new java.awt.GridLayout());

        pack();
    }// </editor-fold>//GEN-END:initComponents

	/**
	 * @param args the command line arguments
	 */
	public static void main( String args[] ) {
		/*
		 * Set the Nimbus look and feel
		 */
		//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
		 * If Nimbus (introduced in Java SE 6) is not available, stay with the
		 * default look and feel. For details see
		 * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
		 */
		try {
			for( javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels() ) {
				if( "Nimbus".equals( info.getName() ) ) {
					javax.swing.UIManager.setLookAndFeel( info.getClassName() );
					break;
				}
			}
		} catch ( ClassNotFoundException ex ) {
			java.util.logging.Logger.getLogger( ItemPreviewComp.class.getName() ).log( java.util.logging.Level.SEVERE, null, ex );
		} catch ( InstantiationException ex ) {
			java.util.logging.Logger.getLogger( ItemPreviewComp.class.getName() ).log( java.util.logging.Level.SEVERE, null, ex );
		} catch ( IllegalAccessException ex ) {
			java.util.logging.Logger.getLogger( ItemPreviewComp.class.getName() ).log( java.util.logging.Level.SEVERE, null, ex );
		} catch ( javax.swing.UnsupportedLookAndFeelException ex ) {
			java.util.logging.Logger.getLogger( ItemPreviewComp.class.getName() ).log( java.util.logging.Level.SEVERE, null, ex );
		}
		//</editor-fold>

		/*
		 * Create and display the form
		 */
		java.awt.EventQueue.invokeLater( new Runnable() {

			public void run() {
				new ItemPreviewComp().setVisible( true );
			}
		} );
	}
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
